using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Diagnostics;
using System.Windows.Forms;

namespace Janus.NorthwindDemo2007
{
	public partial class DataControl
	{

		public virtual Size FullSize
		{
			get
			{
				return this.Size;
			}
		}

		private Janus.NorthwindDemo2007.NorthwindData mDataSource;
		public Janus.NorthwindDemo2007.NorthwindData DataSource
		{
			get
			{
				return mDataSource;
			}
			set
			{
				if (mDataSource != value)
				{
					mDataSource = value;
					OnDataSourceChanged();
				}
			}
		}
		protected virtual void OnDataSourceChanged()
		{

		}
		private bool mAllowEdit = true;
		public bool AllowEdit
		{
			get
			{
				return mAllowEdit;
			}
			set
			{
				if (mAllowEdit != value)
				{
					mAllowEdit = value;
					OnAllowEditChanged();
				}
			}
		}
		protected virtual void OnAllowEditChanged()
		{

		}

		protected void AddBinding(Control control, string propertyName, string dataMember)
		{
			control.DataBindings.Clear();
			if ((mDataSource == null))
			{
				control.Enabled = false;
			}
			else
			{
				control.DataBindings.Add(propertyName, mDataSource, dataMember);
			}
		}

		private bool mIsAddNew;
		public bool IsAddNew
		{
			get
			{
				return mIsAddNew;
			}
			set
			{
				if (mIsAddNew != value)
				{
					mIsAddNew = true;
					OnIsAddNewChanged();
				}
			}
		}
		protected virtual void OnIsAddNewChanged()
		{

		}

		private bool mUseTabBackground;
		public bool UseTabBackground
		{
			get
			{
				return mUseTabBackground;
			}
			set
			{
				if (mUseTabBackground != value)
				{
					mUseTabBackground = value;
					this.OnUseTabBackgroundChanged();
				}
			}
		}
		protected virtual void OnUseTabBackgroundChanged()
		{

		}
	}

} //end of root namespace